<%@page pageEncoding="utf-8" contentType="text/html; charset=utf-8" %>
<%@ include file="/admin/include/init_admin.jsp" %>
<%@ page import="com.welfare.admin.call.*" %>
<%
	out.clear();
	out = pageContext.pushBody(); 
	
	
	String excelTitle = "고객리스트";
	
	response.setHeader("Content-Disposition","attachment;filename="+java.net.URLEncoder.encode(excelTitle, "utf-8")+"_"+StringUtil.today()+".xls");
	response.setHeader("Content-Description","JSP Generated Data");

	
	
	HashBox box = new HashBox(request);

	String s_customer_name		= StringUtil.nvl(request.getParameter("s_customer_name"));
	String s_birth_date			= StringUtil.nvl(request.getParameter("s_birth_date"));
	String s_tel_no				= StringUtil.nvl(request.getParameter("s_tel_no"));
	String s_hp_no				= StringUtil.nvl(request.getParameter("s_hp_no"));
	String s_dong_code			= StringUtil.nvl(request.getParameter("s_dong_code"));
	String s_family_gubn		= StringUtil.nvl(request.getParameter("s_family_gubn"));
	String s_support_gubn		= StringUtil.nvl(request.getParameter("s_support_gubn"));
	String s_remarks			= StringUtil.nvl(request.getParameter("s_remarks"));
	String s_from_birth_date	= StringUtil.nvl(request.getParameter("s_from_birth_date"));
	String s_to_birth_date		= StringUtil.nvl(request.getParameter("s_to_birth_date"));
	
	String sort_col				= StringUtil.nvl(request.getParameter("sort_col"), "to_number(customer_id)");
	String sort_asc				= StringUtil.nvl(request.getParameter("sort_asc"), "desc");


	HashMap infos = new HashMap();
	infos.put("customer_name",	s_customer_name);
	infos.put("birth_date",		s_birth_date);
	infos.put("tel_no",			s_tel_no);
	infos.put("hp_no", 			s_hp_no);
	infos.put("dong_code",		s_dong_code);
	infos.put("family_gubn",	s_family_gubn);
	infos.put("support_gubn",	s_support_gubn);
	infos.put("remarks", 		s_remarks);
	infos.put("from_birth_date", 	s_from_birth_date);
	infos.put("to_birth_date",		s_to_birth_date);
	
	infos.put("sort_col", 		sort_col);
	infos.put("sort_asc", 		sort_asc);
 
	CallDAO dao 	= new CallDAO();
	HashList list 	= dao.selectCustomerList(infos);
	

	list.setHeader("customer_id", 	"번호", 			MetaData.ALIGN_CENTER);
	list.setHeader("customer_name", "이름",			MetaData.ALIGN_LEFT);
	list.setHeader("gender", 		"성별",			MetaData.ALIGN_LEFT);
	list.setHeader("birth_date", 	"생년월일",		MetaData.ALIGN_LEFT);
	list.setHeader("tel_no", 		"전화번호",		MetaData.ALIGN_LEFT);
	list.setHeader("hp_no", 		"핸드폰번호",		MetaData.ALIGN_LEFT);
	list.setHeader("dong_code", 	"행정동",		MetaData.ALIGN_LEFT);
	list.setHeader("address", 		"주소",			MetaData.ALIGN_LEFT);
	list.setHeader("family_gubn", 	"세대구분",		MetaData.ALIGN_LEFT);
	list.setHeader("family_count", 	"가구원수",		MetaData.ALIGN_LEFT);
	list.setHeader("support_gubn", 	"보장구분",		MetaData.ALIGN_LEFT);
	list.setHeader("remarks", 		"비고",			MetaData.ALIGN_LEFT);
	list.setHeader("mod_date", 		"최종수정일",		MetaData.ALIGN_LEFT);
	

	list.writeToExcel(response, excelTitle);

%>
